<?php

use Xin\EasyQueue\PendingDispatch;
use Xin\EasyQueue\Queue;

if (!function_exists('dispatch')) {
    /**
     * 获取队列实例
     * @param string|null $queue
     * @param string|null $connection
     * @return PendingDispatch
     */
    function dispatch($data, $delay = 0, string $queue = null, string $connection = null): PendingDispatch
    {
        return Queue::dispatch($data, $delay, $queue, $connection);
    }
}
